"""
计算1!+2!+3!+......
已知求阶乘的函数如下，利用这个函数，
编程计算并输出5*(1!+2!+...+n!)的值。
注意函数Fact()返回的类型。
unsigned long  Fact(unsigned int  n)
{
    int  i;
    unsigned long result = 1;
    for (i=2; i<=n; i++)
        result *= i;
    return result;
}
"""

"""
# 非递归写法
def fact(n):
    result = 1
    for item in range(1, n+1):
        result *= item
    return result
"""


# 递归写法
def fact(n):
    if n == 1:
        return 1
    else:
        return n*fact(n-1)

def resolution1():
    n = int(input())
    sum = 0

    for item in range(1, n+1):
        sum += fact(item)

    print(f"sum={5*sum}")


if __name__ == '__main__':
    resolution1()